﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace QunYing.Web.market
{
    public partial class myorder : System.Web.UI.Page
    {
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Repeater rp = ((Repeater)Master.FindControl("NavRepeater"));
                rp.DataSource = NavData();
                rp.DataBind();
            }
        }
        /// <summary>
        /// 快捷导航数据
        /// </summary>
        private DataTable NavData()
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("name");
            dt.Columns.Add("url");
            dt.Rows.Add("我的订单", "");
            return dt;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData1();
                BindData2();
            }
        }
        private void BindData1()
        {
            DataTable dt1 = new BLL.OrderInfo().GetOrderInfo(((ArrayList)Session["userInfo"])[0].ToString(),true);
            GridView1.DataSource = dt1;
            GridView1.DataBind();
        }
        private void BindData2()
        {
            DataTable dt2 = new BLL.OrderInfo().GetOrderInfo(((ArrayList)Session["userInfo"])[0].ToString(), false);
            GridView2.DataSource = dt2;
            GridView2.DataBind();
        }
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView1.PageIndex = e.NewPageIndex;
            BindData1();
        }

        protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            GridView2.PageIndex = e.NewPageIndex;
            BindData2();
        }
    }
}
